<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>正则表达式</title>
</head>
<body>
    <h1>正则表达式</h1>
</body>
<script>
// 数量相关：
// {} ? + *;
// let str = "abceeeeeeeeeeeffd";
// // let reg = /ce{3}f/g;
// // let reg = /ce{1,4}f/g;
// // let reg = /ce{1,}f/g
// console.log( reg.test(str) );

// ? --> {0,1}  + ---> {1,} * ---> {0,};
// let str = "my name is lilei";
// let reg = /my\s+name/g;
// console.log( reg.test(str));

let str = "123456789";
// let reg = /\d{2,4}/g;  //贪婪匹配
let reg = /\d{2,4}?/g;   // 惰性匹配；
let res =  str.match(reg);
console.log(res)


</script>
</html>